<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./css/basic.css">
    <title>position定位</title>
    <style>
        .box {
            width: 100vw;
            height: 100vh;
            position: relative;
        }
        
        .box1,
        .box2,
        .box3,
        .box4,
        .box5,
        .box6,
        .box7,
        .box8,
        .box9 {
            width: 100px;
            height: 100px;
            border-radius: 50px;
        }
        
        .box1 {
            background-color: pink;
            position: absolute;
            left: 0;
            top: 0;
        }
        
        .box2 {
            position: absolute;
            left: 50%;
            right: 50%;
            background-color: aqua;
            transform: translate(-50px, 0);
        }
        
        .box3 {
            position: absolute;
            top: 0;
            right: 0;
            background-color: antiquewhite;
        }
        
        .box4 {
            position: absolute;
            top: 50%;
            left: 0;
            background-color: aquamarine;
            transform: translate(0, -50px);
        }
        
        .box5 {
            position: absolute;
            top: 50%;
            left: 50%;
            background-color: bisque;
            transform: translate(-50px, -50px);
        }
        
        .box6 {
            position: absolute;
            top: 50%;
            right: 0;
            background-color: black;
            transform: translate(0, -50px);
        }
        
        .box7 {
            position: absolute;
            bottom: 0;
            left: 0;
            background-color: blueviolet;
        }
        
        .box8 {
            position: absolute;
            left: 50%;
            bottom: 0;
            background-color: burlywood;
            transform: translate(-50px, 0);
        }
        
        .box9 {
            position: absolute;
            right: 0;
            bottom: 0;
            background-color: cadetblue;
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="box1"></div>
        <div class="box2"></div>
        <div class="box3"></div>
        <div class="box4"></div>
        <div class="box5"></div>
        <div class="box6"></div>
        <div class="box7"></div>
        <div class="box8"></div>
        <div class="box9"></div>
    </div>
</body>

</html>